;+
;- from : http://groups.google.com/group/comp.lang.idl-pvwave/browse_thread/thread/51454bd0c912d331?ie=utf-8&oe=utf-8&q=CLUSTER_TREE#5d217c62040e1f8f
;- Credits : 
;- JD Smith
;- Ritter Astrophysical Observatory
;- University of Toledo
;- Toledo, OH 43606
;- 419-530-8528 
;-
FUNCTION cluster_member, clusters
    dims = SIZE(clusters, /DIMENSIONS)
    num = dims[1] + 1
    membership = INTARR(num, num-1)
    work = indgen(num)
    FOR i=0, num-2 DO BEGIN
        newclust = WHERE (work eq clusters[0,i] OR work EQ clusters[1,i])
        work[newclust] = num+i
        membership[0,i] = work
    ENDFOR

    RETURN, membership
END 